package com.zy.tree.redblacktree;

/**
 * @author zhaoyi
 * @date 2021/9/24 16:45
 * 红黑树的节点
 * 简单点就存int值 不重复
 */
public class Node {
    //存放的值
    int value;
    //对应的节点数 当非root节点即子树节点
    int count;
    //是否是红色节点, 否的话就是黑色节点
    //红色链条指向的节点就位红色节点
    boolean isRed;
    Node left, right; //左右子树

    public Node(int value) {
        this.value = value;
    }

    public Node(int value, int count, boolean isRed) {
        this.value = value;
        this.count = count;
        this.isRed = isRed;
    }



    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                ", count=" + count +
                ", isRed=" + isRed +
                '}';
    }
}
